Allow echo-keystrokes but make it quick
authorjustbur <justin@burkett.cc>
Mon, 6 Jul 2015 15:18:55 +0000 (11:18 -0400)
committerjustbur <justin@burkett.cc>
Mon, 6 Jul 2015 15:18:55 +0000 (11:18 -0400)
.gitignore
which-key.el

index 3853c61a77d221d71e0953fcfd7035245f898cb2..34da34edea62d9860699101d93a8456f36c4ce2b 100644 (file)
@@ -1,2 +1,3 @@
+*~
 # Used to setup library paths for emacs -Q
-private-test-setup.el
\ No newline at end of file
+private-test-setup.el
index 37a6e234496395bd256d7640364394c396c6fb71..7c7e16753ba85da52b39be32d197a30bf1ec3954 100644 (file)
@@ -80,8 +80,11 @@ Used when `which-key-popup-type' is frame.")
   (if which-key-mode
       (progn
         (unless which-key--setup-p (which-key/setup))
-        ;; turn off echo-keytrokes for minibuffer (it can interfer)
-        (when (eq which-key-popup-type 'minibuffer) (setq echo-keystrokes 0))
+        ;; make echo-keytrokes fast for minibuffer popup
+       ;; (it can interfer if it's too slow)
+        (when (and (> echo-keystrokes 0)
+                  (eq which-key-popup-type 'minibuffer))
+         (setq echo-keystrokes 0.1))
         (add-hook 'focus-out-hook 'which-key/stop-open-timer)
         (add-hook 'focus-in-hook 'which-key/start-open-timer)
         (which-key/start-open-timer))
@@ -344,7 +347,7 @@ of the intended popup."
          (n-pages (if max-keys/page
                       (ceiling (/ (float n-keys) max-keys/page)) 1))
          pages act-height)
-    (when (> n-columns 0)
+    (when (and (> n-keys 0) (> n-columns 0))
       (dotimes (p n-pages)
         (setq pages
               (push (which-key/create-page max-height n-columns